Object.classPrototype.addProperty

Instance of

Function

Parameters

key /*String*/, value /*Object*/

Return value

key /*String*/

Description

Adds new property to the object.

Example

let obj;
obj.addProperty("first", 1);
obj.addProperty("second", "a");
console.write(obj.first, " ", obj.second);

Expected output

1 a